package com.object;

public enum PKT_RQ_Status {
    H80("允许发送"),
    H01("数据过长"),
    H02("帧类型错误"),
    H03("数据长度与数据包数目不匹配"),
    H04("接收端忙"),
    H82("固件类型错误"),
    H83("版本错误"),
    Hxx("未知状态码");


    private final String info;
    private PKT_RQ_Status(String info){
        this.info = info;
    }

    public static PKT_RQ_Status checkStatus(byte status){
        switch (status){
            case (byte)0x80:
                return H80;
            case (byte)0x01:
                return H01;
            case (byte)0x02:
                return H02;
            case (byte)0x03:
                return H03;
            case (byte)0x04:
                return H04;
            case (byte)0x82:
                return H82;
            case (byte)0x83:
                return H83;
            default:
                return Hxx;
        }
    }

    public String getStatusInfo(){
        return this.info;
    }

}
